<template>
	<view class="activity-coupon">
		<view class="u-m-t-24" v-for="(item,index) in shopCouponList" :key="index">
			<coupon :coupon="item" :type="item.isReceive == 1?1:4" @afterSave="afterSave" :received="true" :dot-style="{backgroundColor:'#f6f6f6'}"/>
		</view>
		<!-- <view class="tab">
			<view class="tab-item" v-for="(item,index) in tabList" :key="index">
				{{item.name}}
			</view>
		</view> -->
	</view>
</template>

<script>
	import coupon from '@/components/cart/coupon.vue'
	import { mapActions, mapState } from 'vuex';
	export default{
		components:{coupon},
		data(){
			return {
				tabList:[{
					name:'店铺类'
				},{
					name:'商品类'
				}]
			}
		},
		computed:{
			...mapState({
				shopCouponList: state => state.activity.shopCouponList,
			})
		},
		created() {
			this.afterSave()
		},
		methods:{
			...mapActions(['ActGetAllActivity']),
			afterSave(){
				this.ActGetAllActivity({storeId:uni.getStorageSync('storeId'),isCoupon:1,isAll:0})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.activity-coupon{
		padding: 0 24rpx;
		.tab{
			background-color: #fff;
			width: 100%;
			line-height: 96rpx;
			display: flex;
			align-items: center;
			justify-content: space-around;
		}
	}
</style>
